/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.hibernate;

import javax.swing.JOptionPane;

import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.tool.hbm2ddl.SchemaExport;

public class GeraBanco {
    public static void main (String [] args){
        try{
        	AnnotationConfiguration cfg = new AnnotationConfiguration();
        	cfg.configure();
        	
        	SchemaExport se = new SchemaExport(cfg);
        	se.create(true, true);
     
        	JOptionPane.showMessageDialog(null, "Banco Gerado com Sucesso!");
        }catch(Exception e){
        	JOptionPane.showMessageDialog(null, "erro: " + e);
        }
        /*
         * 
         */
    }
    
}
